--[[------------------------------------
			APEX FRAMEWORK
	Developed by Ren, from zDark.com
------------------------------------]]--

function GM:PlayerSpawn(pl)
	pl:SetGravity(1)
	pl:SetTeam(1)
	pl:SetRunSpeed(300)
	pl:SetWalkSpeed(150)
	pl:Give("gmod_tool")
	pl:Give("weapon_physgun")
	pl:Give("gmod_camera")
	
	if (pl:IsSuperAdmin()) then
		pl:SetModel("models/player/combine_super_soldier.mdl")
	elseif (pl:IsAdmin()) then
		pl:SetModel("models/player/police.mdl")
	else	
		pl:SetModel("models/player/Group01/male_09.mdl")
	end
	
end

function GM:GetFallDamage( ply, speed )
	return ( speed / 8 )
end

function GM:PlayerGiveSWEP( ply, class, wep )
	if (!ply:IsSuperAdmin() || !ply:IsAdmin()) then
	return false
	else return true
	end
end

function GM:PlayerSpawnSWEP( ply, class, wep )
	if (!ply:IsSuperAdmin() || !ply:IsAdmin()) then
	return false
	else return true
	end
end

local models = { 	"crane_frame.mdl", 
					"Combine_Citadel001.mdl", 
					"Combine_Citadel001_open.mdl",
					"Combine_Citadel001b.mdl",
					"Combine_Citadel001b_open.mdl",
					"cell_array_01.mdl",
					"cell_array_01_extended.mdl",
					"cell_array_02.mdl",
					"cell_01_supportsb.mdl",
					"cell_01_supports.mdl",
					"cell_array_03.mdl",
					"big_ramp.mdl",
					"canal_bridge03a.mdl",
					"oildrum001_explosive.mdl",
					"mk-82.mdl",
					"ww2bomb.mdl",
					"torpedo.mdl",
					"amraam.mdl",
					"flakshell_big.mdl",
					"oildrum001_explosive.mdl",
					"building_002a.mdl",
					"project_building01.mdl",
					"row_res_2_ascend_fullscale.mdl"
				}
				
function APEX.Props( pl, mdl )

	//timer.Create("APEX.PropTimerTimer", 1, 1, APEX.PropTimerDestroyer)
	
	//if (timer.IsTimer("APEX.PropTimer")) then
	//	return false
	//else 

		for _, v in pairs( models ) do
			if string.find( mdl, v ) then
				if (!pl:IsAdmin() || !pl:IsSuperAdmin()) then
				pl:PrintMessage( HUD_PRINTCENTER, "This PROP Has Been Denied!" )
				return false
				else return true
				end
		
			end
		end
	//end
	
	//timer.Create("APEX.PropTimer", 1, 1, MsgN, "APEX - Anti-Spamming Enabled!")
end
hook.Add( "PlayerSpawnProp", "APEX.Props", APEX.Props )

//function APEX.PropTimerDestroyer()
//timer.Destroy("APEX.PropTimer")
//end

function APEX.SRestriction( pl, x )
 
    if x == "sent_ball" then
 
	pl:PrintMessage(HUD_PRINTCENTER, "This SENT Has Been Denied!")
 
	return false 
    end
 
end
 
hook.Add( "PlayerSpawnSENT", "APEX.SRestriction", APEX.SRestriction )